package SketchPackage;

import processing.core.PApplet;
import processing.core.PFont;

public class Cell
{
  // Dimension
  int mWidth = 0;
  int mHeight = 0;

  // Position
  int mPosX = 0;
  int mPosY = 0;

  // Coloring
  float mFillR = 255;
  float mFillG = 255;
  float mFillB = 255;

  PApplet parent;

  PFont font;

  public Cell(PApplet p)
  {
    parent = p;
    font = null;
  }

  public Cell(PApplet p, PFont f)
  {
    this( p );
    font = f;
  }

  void mDraw(
      float mFillR,
      float mFillG,
      float mFillB,
      int mPosX,
      int mPosY,
      int mWidth,
      int mHeight)
  {
    // Coloring
    this.mFillR = mFillR;
    this.mFillG = mFillG;
    this.mFillB = mFillB;

    parent.fill( mFillR, mFillG, mFillB );

    // Dimension
    this.mWidth = mWidth;
    this.mHeight = mHeight;

    // Position
    this.mPosX = mPosX;
    this.mPosY = mPosY;

    parent.rect( mPosX, mPosY, mWidth, mHeight );
  }

  void cDraw(char ch, int mPosX, int mPosY)
  {
    parent.textFont( font, 16 );
    parent.fill( 0 );
    parent.text( ch, mPosX, mPosY );
  }
}
